import request from '../utils/request'

export function getConsult () {
  return request({
    url: 'app/consult/type',
    method: 'get'
  })
}

export function postConsultType (data) {
  return request({
    url: 'app/consult/type',
    method: 'post',
    data: data
  })
}

export function getConsultAnswer (question, type, pageSize, currentPage) {
  return request({
    url: 'app/consult/answer',
    method: 'get',
    params: {
      question: question,
      type: type,
      'page-size': pageSize,
      'current-page': currentPage
    }
  })
}

export function putConsultAnswer (data) {
  return request({
    url: 'app/consult/answer',
    method: 'put',
    data: data
  })
}

export function postConsultAnswer (data) {
  return request({
    url: 'app/consult/answer',
    method: 'post',
    data: data
  })
}

export function postConsultAnswerUp (id) {
  return request({
    url: 'app/consult/answer/up',
    method: 'post',
    params: {
      id: id
    }
  })
}

export function postConsultAnswerDown (id) {
  return request({
    url: 'app/consult/answer/down',
    method: 'post',
    params: {
      id: id
    }
  })
}

export function deleteConsultAnswer (id) {
  return request({
    url: 'app/consult/answer',
    method: 'delete',
    data: {
      id: id
    }
  })
}
